package com.project.controller;

import com.project.bean.CutPageBean;
import com.project.bean.OrderBean;
import com.project.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("order")
public class OrderController {
    @Autowired
    private IOrderService service;

    @RequestMapping("cutAll")
    public CutPageBean<OrderBean> cutAll(Integer pageNO){
        return service.cutAll(pageNO);
    }

    @RequestMapping("findById")
    public OrderBean findById(Integer id){
        return service.findById(id);
    }

    @RequestMapping("add")
    public String add(OrderBean order){
        service.add(order);
        return "ok";
    }

    @RequestMapping("del")
    public String del(Integer id){
        service.del(id);
        return "ok";
    }

    @RequestMapping("update")
    public String update(Integer id,String address){
        service.update(id,address);
        return "ok";
    }
}
